package network;

import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Map;





public class MyDicServer extends MyServer{

    private Map<String,String> map = new HashMap<>();

    public MyDicServer(int port) throws SocketException {
        super(port);
        map.put("cat","小猫");
        map.put("dog", "小狗");
        map.put("dusk", "小鸭");
    }

    @Override
    public String process(String request) {
        return  map.getOrDefault(request,"未知单词");
    }

    public static void main(String[] args) throws IOException {
        MyServer m = new MyDicServer(9090);
        m.start();
    }
}
